<html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<head>
	<title>Регистрация</title>
	<link rel="stylesheet" type="text/css" href="../css/styles1.css">
	<meta http-equiv="Content-Language" content="ru" />
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
	<?php
		include('../../System/config_sql.php');
		include("../blocks/inc.html");
	?>
	<div class="corners" style="margin-left: 21%; margin-right: 10px"><div ><div><div >
	<div style="padding:10px; ">
	<?php
	include('../../System/config_sql.php');
	include_once('../../System/classes/Service/Database.php');
	$objDB = Service_Database::instance();
	if(isset($_POST['breg'])) {
		//function hash($password) {
		   //$password = md5($password)
			//return $password;
		//}
		//$password = hash($password);
		if($_POST['password'] = $_POST['repeatPassword'] ) {
		  $arrUser['login'] = $_POST['name'];
		  $arrUser['email'] = $_POST['mail'];
		  $arrUser['pass'] = md5($_POST['password']);
		  
		  $objDB->insert('user', $arrUser);
		  echo ('Данные успешно добавлены');
		}
		else {
			echo('Введите пароли еще раз')."<br/>";
			echo("<a href='Registartion form.php'>К регистрации</a>");
		};
	};
	
	if (isset($_POST['login'])) {
		$objSess->logIn($_POST['user'], $_POST['pass'], false);
		$objSess->moveTo('main.php');
	}
	?>
	</>
	</div></div></div></div>
	
	<?php include("../blocks/inc1.html"); ?>

</body>
</html>